package com.jzo2o.customer.controller.operation;

import com.jzo2o.common.model.PageResult;
import com.jzo2o.customer.model.domain.AgencyCertificationAudit;
import com.jzo2o.customer.model.domain.WorkerCertificationAudit;
import com.jzo2o.customer.model.dto.request.AgencyCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.service.IAgencyCertAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController("operationAgencyCertAuditController")
@RequestMapping("/operation/agency-certification-audit")
@Api("机构人员实名认证")
public class AgencyCertAuditController {
    @Resource
    private IAgencyCertAuditService agencyCertAuditService;

    @GetMapping("/page")
    @ApiOperation("分页查询机构人员实名认证信息接口")
    public PageResult<AgencyCertificationAudit> page(@ApiParam(name = "dto", value = "分页查询参数")
                                                     AgencyCertificationAuditPageQueryReqDTO dto) {
        return agencyCertAuditService.pageInfo(dto);
    }

    @PutMapping("/audit/{id}")
    @ApiOperation("机构人员实名认证接口")
    public void audit(@PathVariable("id") @ApiParam(name = "id", value = "id")
                      Long id,
                      @ApiParam(name = "WorkerCertificationAudit", value = "认证参数")
                      WorkerCertificationAudit wca) {
        agencyCertAuditService.audit(id, wca);
    }
}
